<?
include "conf/db_connect.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Harta site</title>
<base href="<?=$CS?>" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div align="left" style="padding:15px">
  <ul>
    <li><a href="<?=$CS?>">Home</a></li>
	<?
	 $sql = "select * from categorii order by nume";
	 $res = mysql_query($sql) or die(mysql_error());
	 while($cat = mysql_fetch_array($res)){
	 	$rep = array(" ","'",'"',"?","%","&");
	 	$lnk = $CS."articole/".$cat['link']."/";
	 	echo '<li><a href="'.$lnk.'">'.$cat['nume'].'</a>';
		$sql = "select * from articole where categorie_id = '{$cat['id']}' order by id desc";
		$re = mysql_query($sql);
		while($a = mysql_fetch_array($re)){
			$l_a = $CS."articol/".str_replace($rep,"-",$a['titlu'])."/".$a['id']."/";
			echo '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$l_a.'">'.$a['titlu'].'</a><br />';
		}
		echo '</li>';
	 }
	?>
    <li><a href="<?=$CS?>newsletter/">Newsletter</a></li>
    <li><a href="<?=$CS?>contact/">Contact</a></li>
  </ul>
</div>
</body>
</html>
